﻿CREATE PROCEDURE dbo.sem_Arrived
	@LoanID int
As

DECLARE @User varchar(128),@MenuLabel varchar(50)

SET @MenuLabel = 'ME_'+dbo.MenuLabelByLoanID(@LoanID)

DECLARE cur CURSOR LOCAL FOR
SELECT Value FROM dbo.RegistryValues(@MenuLabel)

OPEN cur

FETCH NEXT FROM cur INTO @User

WHILE @@FETCH_STATUS = 0
BEGIN
	PRINT 'sem_Arrived<>User:'+@User
	EXEC s_MenuArriveMsg @LoanID,@User
	FETCH NEXT FROM cur INTO @User
END

CLOSE cur
DEALLOCATE cur



